/// _id : "60e7f7b95e0cf727067cb8d8"
/// hasCp : true
/// title : "俗世妖人"
/// aliases : ""
/// cat : "其他"
/// author : "南无袈裟理科佛"
/// site : "zhuishuvip"
/// cover : "/agent/http%3A%2F%2Fimg.1391.com%2Fapi%2Fv1%2Fbookcenter%2Fcover%2F1%2F3583591%2F3583591_286f197325cb484c944cd1e36f85b675.jpg%2F"
/// shortIntro : "\"巴中许秀，人在山城，剧本杀线下店老板，前狼人杀大神，风水世家出身，胰腺癌晚期患者。\r\n爷爷去世，留下一具毫无生机的绝世美女，为了求活，许秀不得不拖家带口，领着一家子老弱病残，拳打南天门敬老院，脚踹地府幼儿园，挣扎求存，打出一片天地……\r\n直到有一天，这个世界上，最强的魔王拦住了他，对他说……\r\n“不许秀！”\"\r\n"
/// lastChapter : "第八十九章 鬼吊顶洞，幽暗恐怖"
/// retentionRatio : 44.33
/// banned : 0
/// allowMonthly : false
/// latelyFollower : 11459
/// wordCount : 251336
/// contentType : "txt"
/// superscript : ""
/// sizetype : -1

class BookModel {
  String? id;
  bool? hasCp;
  String? title;
  String? aliases;
  String? cat;
  String? author;
  String? site;
  String? cover;
  String? shortIntro;
  String? lastChapter;
  dynamic retentionRatio;
  int? banned;
  bool? allowMonthly;
  int? latelyFollower;
  int? wordCount;
  String? contentType;
  String? superscript;
  int? sizetype;

  BookModel({
      this.id,
      this.hasCp,
      this.title,
      this.aliases,
      this.cat,
      this.author,
      this.site,
      this.cover,
      this.shortIntro,
      this.lastChapter,
      this.retentionRatio,
      this.banned,
      this.allowMonthly,
      this.latelyFollower,
      this.wordCount,
      this.contentType,
      this.superscript,
      this.sizetype
  });

  BookModel.fromJson(dynamic json) {
    id = json["_id"];
    hasCp = json["hasCp"];
    title = json["title"];
    aliases = json["aliases"];
    cat = json["cat"];
    author = json["author"];
    site = json["site"];
    cover = json["cover"];
    if(cover!=null){
      cover = Uri.decodeFull(cover!);
      if(cover!.startsWith("/agent/")){
        cover=cover!.split("/agent/")[1];
      }
    }
    shortIntro = json["shortIntro"];
    lastChapter = json["lastChapter"];
    retentionRatio = json["retentionRatio"];
    banned = json["banned"];
    allowMonthly = json["allowMonthly"];
    latelyFollower = json["latelyFollower"];
    wordCount = json["wordCount"];
    contentType = json["contentType"];
    superscript = json["superscript"];
    sizetype = json["sizetype"];
  }

  Map<String, dynamic> toJson() {
    var map = <String, dynamic>{};
    map["_id"] = id;
    map["hasCp"] = hasCp;
    map["title"] = title;
    map["aliases"] = aliases;
    map["cat"] = cat;
    map["author"] = author;
    map["site"] = site;
    map["cover"] = cover;
    map["shortIntro"] = shortIntro;
    map["lastChapter"] = lastChapter;
    map["retentionRatio"] = retentionRatio;
    map["banned"] = banned;
    map["allowMonthly"] = allowMonthly;
    map["latelyFollower"] = latelyFollower;
    map["wordCount"] = wordCount;
    map["contentType"] = contentType;
    map["superscript"] = superscript;
    map["sizetype"] = sizetype;
    return map;
  }

}